;Copyright 2007-2010 Niko Carpenter and Tyler Spivey
;    This file is part of Linna Home Server.
;    Linna Home is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation, either version 3 of the License, or
;    any later version.

;    Linna Home is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.

;    You should have received a copy of the GNU General Public License
;    along with Linna Home.  If not, see http://www.gnu.org/licenses/.
#include-once
func p_cmdinteract($id,$str)
if $str = " quit " Then
dSend($id,"Finished interacting with "&$Cons[$id][$C_pdata])
lreturn($id)
return
EndIf
if not ProcessExists($cons[$id][$C_Pdata]) Then
dSend($id,"Finished interacting with "&$Cons[$id][$C_pdata])
lreturn($id)
return
EndIf
$str = StringReplace($str, "\n", @LF)
$str = StringReplace($str, "\r", @CR)
StdInWrite($cons[$id][$C_pdata],$str)
EndFunc